package com.freeman.cement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.freeman.cement.entity.Staff;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface StaffDao extends BaseMapper<Staff> {
    Staff selectStaffsByUserCode(@Param("userCode") String userCode);

    Staff getStaffById(@Param("id") int id);

    List<Staff> selectAllStaff();

    Staff UserLoginCheck(@Param("username") String username, @Param("password") String password);

    Staff selectOriginStaffByUserCode(Staff staff);

    void addStaff(Staff staff);

    void deleteStaff(Staff staff);

    void updateStaff(Staff staff);

    void updateLoginTime(@Param("id") int id, @Param("loginTime") Date loginTime);

    void updateLogoutTime(@Param("id") int id, @Param("logoutTime") Date logoutTime);

    List<Staff> selectStaff(Staff staff);

    List<Staff> selectStaffByKeyword(@Param("keyword") String keyword);
}
